using System;
using PropertyExpression.Common;

namespace PropertyExpression.ReactiveRelation
{
    internal class OneToManyCollectionNewItemProcessor : IOneToManyCollectionNewItemProcessor
    {
        private readonly Func<IOptionalResult<IOneToManyCollectionNewItemProvider>> func;

        public OneToManyCollectionNewItemProcessor(
            Func<IOptionalResult<IOneToManyCollectionNewItemProvider>> func)
        {
            this.func = func;
        }

        public IOptionalResult<IOneToManyCollectionNewItemProvider> Process()
        {
            return func();
        }
    }
}